

            function addArduinoCod (Blockly) {
            
                        

                        
        Blockly.Arduino['EXT_TRAFFIC_LIGHT_BLOCK_1607913830627'] = function(block)
        {
            let g_pin = this.getFieldValue('g_pin');
let y_pin = this.getFieldValue('y_pin');
let r_pin = this.getFieldValue('r_pin');
let r = this.getFieldValue('r');
let g = this.getFieldValue('g');
let y = this.getFieldValue('y');
let time =  Blockly.Arduino.valueToCode(this, 'time', Blockly.Arduino.ORDER_ATOMIC);
          
            Blockly.Arduino.definitions_['include_EXT_TRAFFIC_LIGHT_BLOCK_1607913830627'] = ``;
            Blockly.Arduino.definitions_['define_EXT_TRAFFIC_LIGHT_BLOCK_1607913830627'] = `#define RGB_RED${r_pin}    ${r_pin}\r\n#define RGB_GREEN${g_pin}    ${g_pin}\r\n#define RGB_YELLOW${y_pin}    ${y_pin}`;
            Blockly.Arduino.definitions_['setup_EXT_TRAFFIC_LIGHT_BLOCK_1607913830627'] = `pinMode(RGB_RED${r_pin}, OUTPUT);\r\n  pinMode(RGB_GREEN${g_pin}, OUTPUT);\r\n  pinMode(RGB_YELLOW${y_pin}, OUTPUT);`;
             return  `digitalWrite(RGB_GREEN${g_pin},${g});\r\ndigitalWrite(RGB_YELLOW${y_pin},${y});\r\ndigitalWrite(RGB_RED${r_pin},${r});\r\ndelay(${time});\r\n`;
        }
                    
            return Blockly;
            }

            module.exports = addArduinoCod ;

        